export enum AddressInfoDirection {
    // 发货人
    Sender = '1',
    // 收货人
    Getter = '2'
}

export function AddressInfoDirectionCN(status: string) {
    switch (status) {
        case AddressInfoDirection.Sender:
            return '发货';
        case AddressInfoDirection.Getter:
            return '收货';
    }
}


export interface DataResult<T> {
    code: number;
    msg: string;
    data: T;
}

export interface GoodsListType {
    goodsType: string;
    goodsNumber: string;
    goodsName: string;
    weigh: string;
    goodsVolume: string;
    packing: string;
    upNumber: string;
}
export interface CostListType {
    ssopRemark: string;
    actualMoney: number;
    paidMoney: number;
    paid: string;
}

// 运单类型
export interface OrderListType {
    sendInfo: {
        sendUser: string;
        sengPhone: string;
        sendAddress: string;
    };
    wxStatus: number;
    status: number;
    clearingForm: number;
    isExamine: number;
    billNo: string;
    startBranchName: string;
    pickUpCode: string;
    goodsInfo: GoodsListType[];
    orderCode: string;
    shipper: string;
    receiver: string;
    destinationBranchName: string;
    ssoId: string;
    statusVal?: string;
    location: string;
    assistAdd: string;
    billServer: string;
    returnType: number;
    returnCycle: number;
    collectionMoney: number;
    loadType: number;
    insuredMoney: string;
    sendType: string;
    isurgent: string;
    pickUpMode: string;
    shipperMobile: string;
    receiverMobile: string;
    fromAdd: string;
    shipperId: string;
    shipperTel: string;
    receiverTel: string;
    costList: CostListType[];
    sendGoodsMiles: number;
    deliveryTime: string;
    deliveryType: string;
    goodsType: number;
    dischargeCargo: string;
    dischargeElevator: number;
    elevatorNum: number;
    customerCode: string;
    startBranch: string;
    destinationBranch: string;
    billingTime: string;
    noForGoods: string;
    destination: string;
    warehouse: string;
}

// 网点类型
export interface CompanyInfoType {
    address: string;
    point_lng: string;
    point_lat: string;
    tel: string;
    province: string;
    city: string;
    administrativeDivision: string;
    companyName: string;
    manager: string;
    note: string;
    localX: string;
    localY: string;
}

export interface ApiResult<T> {
    code: number;
    msg: string;
    rows: T;
    total: number; // 定义一个可选的 total 参数
}

export interface DataResult<T> {
    code: number;
    msg: string;
    data: T;
}

export interface InfoResult<T> {
    code: number;
    msg: string;
    info: T;
}

interface Trajectorys {
    billNo: string;
    creaTetime: number;
    eventType: string;
    lat: number;
    lng: number;
    orderStatus: string;
    orderStatusName: string;
    seqNo: null;
    ssotId: string;
    trackTime: number;
}

export interface LogisticsType {
    trajectorys: Trajectorys[];
    eLat: number;
    eLng: number;
    sLng: number;
    sLat: number;
}

// 添加地址薄
export interface addrbookAdd {
    btcaId: string;
    creaTetime: string;
    customerCode: string;
    email: string;
    infoType: string;
    isDefault: string;
    latitude: string;
    longitude: string;
    preAdd: string;
    preAddress: string;
    preAddressNote: string;
    preArea: string;
    preMobile: string;
    preName: string;
    preTel: string;
    updateTime: string;
}

// 网点运单页查询各类型运单
export interface WaybillType {
    btcId: string; // ID
    work: boolean; // 工作人员公众号全部订单
    keywords: string; // 关键字
    wxStatus?: number | string; // 微信的状态
    pickUpMode?: number; // 提货方式
    examineFlag?: boolean; // 只显示工作人员网点的承运单和预订单
    record?: boolean;
    isReceiving?: number | string; // 待确认用
    flag?: number | string; // 待支付用
    startBillingTime?: string; // 开始时间
    endBillingTime?: string; // 结束时间
}
